import redis
from datetime import datetime
import sys
import time
        
if __name__ == '__main__':
    pref = 'zero'
    if len(sys.argv) >1:
        pref = sys.argv[1]
        
    redis_svr =  '192.168.100.80'
    r = redis.Redis(redis_svr)

    start_time = datetime.now()
    cmd=[]
    for i in range(1,30000):
        key = 'sdb_key%d' % i
        cmd.append(key)
    print 'ready', datetime.now()-start_time    
    #print cmd
    
    while 1:    
        start_time = datetime.now()    
        rs = r.mget(cmd)
        print 'end', datetime.now()-start_time
        print len(rs)
        #time.sleep(1)



        #time.sleep(1)